require 'middleclass'
require 'Display'
require 'SpriteHelper'

Planet = class('Planet', Display)

function Planet:initialize(imageSheet,sheet,x, y,radio,atmosfera)
    local planet = display.newImageRect(imageSheet,sheet, radio *2,radio * 2)
    planet.x = x
    planet.y = y
    Display.initialize(self, planet) 
    physics.addBody(self.body, "static", { density = 0.8, friction = 0.2, bounce = 0.0, radius = radio })
    
    local pran = math.random (1, 5)
    self.radio = radio
    -- voy a limitar la gravedad
    self.gravity = math.min(radio,70)/50 
    self.atmosfera= atmosfera
    self.player = nil
    
    --atmosfera
    self.atmosferaCircle=display.newImageRect(imageSheet,SpriteHelper.sheets.atmosphere, (radio + atmosfera) *2,(radio + atmosfera) * 2)
    self.atmosferaCircle.x=x
    self.atmosferaCircle.y=y
    self.atmosferaCircle.alpha = 0.6
    self.isFinal = false
end

